<template>
  <div style="width:400px;">
    <ocean :use="form"></ocean>
  </div>
</template>
<script lang="tsx" setup>
import { useForm } from '@/ocean';
import { ref } from 'vue';
import { GlobalAPI, UserAPI } from '@/app/api';

type Model = {
  id: number
  // status: number
  storeId: number
}

let props = defineProps<{
  row: Model,
}>()

let storeList = ref([]);

let form = useForm<Model>();
// form.item('审核结果', 'status').select({ options: [{ label: '通过', value: 1 }, { label: '未通过', value: 2 }] });
form.item('绑定门店', 'storeId').select({ options: storeList, labelField: 'storeName', valueField: 'id' });

GlobalAPI.queryAllStoreList().then(data => storeList.value = data);

const submit = () => {
  return UserAPI.examineUser({
    id: props.row.id,
    // status: form.model.status,
    storeId: form.model.storeId,
  });
}

defineExpose({ submit });
</script>